package com.wxyzz.satserver.message.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wxyzz.satserver.message.dao.MessageMapper;
import com.wxyzz.satserver.message.entity.Message;
import com.wxyzz.satserver.message.service.IMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@Service
public class MessageServiceImpl implements IMessageService {
    @Resource
    private MessageMapper messageMapper;
    @Override
    public List<Message> getMessage(int sessionId) {
        List<Message> messageList = messageMapper.getMessagesBySessionId(sessionId);
        Collections.reverse(messageList);
        return messageList;
    }
}
